<div class="box">
    <div class="heading">
        <h1><img alt="" src="<?php echo base_url('assets/admin/images/review.png'); ?>">All States</h1>
		<div class="buttons">
            <ul id="add_entry_btn">
                <li id="add_entry_li">
                    <a class="button" rel="#entry_content_types" id="add_state" href="<?php echo base_url(ADMIN_PATH . '/setting/addstate'); ?>"><span>Add State</span></a>
                </li>
                <li>
                    <a class="button delete" href="#"><span>Delete</span></a>
                </li>
            </ul>
        </div>  
    </div>
    <div class="content">
		
		<?php echo form_open(null, 'id="form"'); ?>
        <table id="entries_table" class="list">
            <thead>
                <tr>
                    <th width="1" class="center"><input type="checkbox" onClick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></th>
					<th class="right"><a rel="id" class="sortable" href="#">#ID</a></th>
                    <th>Country Name</a></th>
                    <th>State Name</a></th>
					<th>State Code</a></th>
					
                    <th class="right">Action</th>
                </tr>
            </thead>
            <tbody>
			
                <?php if ($states){?>
                    <?php foreach($states as $state){ ?>
                    <tr>
                        <td class="center"><input type="checkbox" value="<?php echo $state['stateid'] ?>" name="selected[]" /></td>
						<td><?php echo $state['stateid']; ?></td>
						<td><?php echo $state['country_name']; ?></td>
                        <td><?php echo $state['state_name']; ?></td>
                        <td class="right"><?php echo $state['code']; ?></td>
                        <td class="right">[ <?php echo anchor(ADMIN_PATH . "/setting/editstate/" . $state['stateid'], 'Edit'); ?> ]</td>
                    </tr>
                    <?php } ?>
                <?php }else { ?>
                    <tr class="center"><td colspan="10">No results found.</td></tr>
                <?php } ?>
            </tbody>
        </table>
		<div id="paging">
				<?php if($pagination): ?>
					
					<div class="pagination">
						<div class="links"><?php echo $pagination; ?></div>
					</div>
				<?php endif; ?>
			</div>
        <?php echo form_close(); ?>
        
    </div>
</div>

